package handler

import (
	"github.com/gin-gonic/gin"
	"zoo-manage/model"
)

func AddArticle(c *gin.Context) {
	title := c.PostForm("title")
	comment := c.PostForm("comment")
	author := c.PostForm("author")
	data := model.Article{
		Title:   title,
		Comment: comment,
		Author:  author,
	}
	model.DB.Create(&data)
	c.JSON(200, gin.H{
		"code": 200,
		"msg":  "成功",
	})
	return
}
